package com.hr.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hr.system.mapper.ClockRuleMapper;
import com.hr.system.domain.ClockRule;
import com.hr.system.service.IClockRuleService;
import com.hr.common.core.text.Convert;

/**
 * 考勤规则Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-03-10
 */
@Service
public class ClockRuleServiceImpl implements IClockRuleService 
{
    @Autowired
    private ClockRuleMapper clockRuleMapper;


    @Override
    public ClockRule selectClockRuleByYearAndTenantId(ClockRule clockRule) {
        return clockRuleMapper.selectClockRuleByYearAndTenantId(clockRule);
    }

    /**
     * 查询考勤规则列表
     * 
     * @param clockRule 考勤规则
     * @return 考勤规则
     */
    @Override
    public List<ClockRule> selectClockRuleList(ClockRule clockRule)
    {
        return clockRuleMapper.selectClockRuleList(clockRule);
    }

    /**
     * 新增考勤规则
     * 
     * @param clockRule 考勤规则
     * @return 结果
     */
    @Override
    public int insertClockRule(ClockRule clockRule)
    {
        return clockRuleMapper.insertClockRule(clockRule);
    }

    /**
     * 修改考勤规则
     * 
     * @param clockRule 考勤规则
     * @return 结果
     */
    @Override
    public int updateClockRule(ClockRule clockRule)
    {
        return clockRuleMapper.updateClockRule(clockRule);
    }

    /**
     * 删除考勤规则对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteClockRuleByIds(String ids)
    {
        return clockRuleMapper.deleteClockRuleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤规则信息
     * 
     * @param id 考勤规则ID
     * @return 结果
     */
    @Override
    public int deleteClockRuleById(Long id)
    {
        return clockRuleMapper.deleteClockRuleById(id);
    }
}
